<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      6.58.&nbsp;Sysvinit-2.88dsf
    </title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="lfs" id="lfs-7.3">
    <div class="navheader">
      <h4>
        Linux From Scratch - Version 7.3
      </h4>
      <h3>
        Chapter&nbsp;6.&nbsp;Installing Basic System Software
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="sysklogd.html" title="Sysklogd-1.5">Prev</a>
          <p>
            Sysklogd-1.5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="tar.html" title="Tar-1.26">Next</a>
          <p>
            Tar-1.26
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
    <div class="wrap" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="ch-system-sysvinit" name="ch-system-sysvinit"></a>6.58.
        Sysvinit-2.88dsf
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <p>
          The Sysvinit package contains programs for controlling the startup,
          running, and shutdown of the system.
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Approximate build time:</strong>
              <span class="segbody">less than 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Required disk space:</strong>
              <span class="segbody">1.4 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          6.58.1. Installation of Sysvinit
        </h2>
        <p>
          When run-levels are changed (for example, when halting the system),
          <span class="command"><strong>init</strong></span> sends
          termination signals to those processes that <span class=
          "command"><strong>init</strong></span> itself started and that
          should not be running in the new run-level. While doing this,
          <span class="command"><strong>init</strong></span> outputs messages
          like &ldquo;<span class="quote">Sending processes the TERM
          signal</span>&rdquo; which seem to imply that it is sending these
          signals to all currently running processes. To avoid this
          misinterpretation, modify the source so that these messages read
          like &ldquo;<span class="quote">Sending processes configured via
          /etc/inittab the TERM signal</span>&rdquo; instead:
        </p>
        <pre class="userinput">
<kbd class=
"command">sed -i 's@Sending processes@&amp; configured via /etc/inittab@g' src/init.c</kbd>
</pre>
        <p>
          Maintained versions of the <span class=
          "command"><strong>wall</strong></span>, <span class=
          "command"><strong>mountpoint</strong></span>, and <span class=
          "command"><strong>utmpdump</strong></span> programs were installed
          earlier by Util-linux. Suppress the installation of Sysvinit's
          versions of these programs and their man pages:
        </p>
        <pre class="userinput">
<kbd class="command">sed -i -e '/utmpdump/d' \
       -e '/mountpoint/d' src/Makefile</kbd>
</pre>
        <p>
          Compile the package:
        </p>
        <pre class="userinput">
<kbd class="command">make -C src</kbd>
</pre>
        <p>
          This package does not come with a test suite.
        </p>
        <p>
          Install the package:
        </p>
        <pre class="userinput">
<kbd class="command">make -C src install</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="contents-sysvinit" name="contents-sysvinit"></a>6.58.2.
          Contents of Sysvinit
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed programs:</strong>
              <span class="segbody">bootlogd, fstab-decode, halt, init,
              killall5, last, lastb (link to last), mesg, pidof (link to
              killall5), poweroff (link to halt), reboot (link to halt),
              runlevel, shutdown, sulogin, and telinit (link to init)</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="bootlogd" name="bootlogd"></a><span class=
                    "term"><span class=
                    "command"><strong>bootlogd</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Logs boot messages to a log file
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="fstab-decode" name="fstab-decode"></a><span class=
                    "term"><span class=
                    "command"><strong>fstab-decode</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Run a command with fstab-encoded arguments
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="halt" name="halt"></a><span class=
                    "term"><span class=
                    "command"><strong>halt</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Normally invokes <span class=
                    "command"><strong>shutdown</strong></span> with the
                    <em class="parameter"><code>-h</code></em> option, except
                    when already in run-level 0, then it tells the kernel to
                    halt the system; it notes in the file <code class=
                    "filename">/var/log/wtmp</code> that the system is being
                    brought down
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="init" name="init"></a><span class=
                    "term"><span class=
                    "command"><strong>init</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    The first process to be started when the kernel has
                    initialized the hardware which takes over the boot
                    process and starts all the proceses it is instructed to
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="killall5" name="killall5"></a><span class=
                    "term"><span class=
                    "command"><strong>killall5</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Sends a signal to all processes, except the processes in
                    its own session so it will not kill the shell running the
                    script that called it
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="last" name="last"></a><span class=
                    "term"><span class=
                    "command"><strong>last</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Shows which users last logged in (and out), searching
                    back through the <code class=
                    "filename">/var/log/wtmp</code> file; it also shows
                    system boots, shutdowns, and run-level changes
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="lastb" name="lastb"></a><span class=
                    "term"><span class=
                    "command"><strong>lastb</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Shows the failed login attempts, as logged in
                    <code class="filename">/var/log/btmp</code>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="mesg" name="mesg"></a><span class=
                    "term"><span class=
                    "command"><strong>mesg</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Controls whether other users can send messages to the
                    current user's terminal
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pidof" name="pidof"></a><span class=
                    "term"><span class=
                    "command"><strong>pidof</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Reports the PIDs of the given programs
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="poweroff" name="poweroff"></a><span class=
                    "term"><span class=
                    "command"><strong>poweroff</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Tells the kernel to halt the system and switch off the
                    computer (see <span class=
                    "command"><strong>halt</strong></span>)
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="reboot" name="reboot"></a><span class=
                    "term"><span class=
                    "command"><strong>reboot</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Tells the kernel to reboot the system (see <span class=
                    "command"><strong>halt</strong></span>)
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="runlevel" name="runlevel"></a><span class=
                    "term"><span class=
                    "command"><strong>runlevel</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Reports the previous and the current run-level, as noted
                    in the last run-level record in <code class=
                    "filename">/var/run/utmp</code>
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="shutdown" name="shutdown"></a><span class=
                    "term"><span class=
                    "command"><strong>shutdown</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Brings the system down in a secure way, signaling all
                    processes and notifying all logged-in users
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="sulogin" name="sulogin"></a><span class=
                    "term"><span class=
                    "command"><strong>sulogin</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Allows <code class="systemitem">root</code> to log in; it
                    is normally invoked by <span class=
                    "command"><strong>init</strong></span> when the system
                    goes into single user mode
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="telinit" name="telinit"></a><span class=
                    "term"><span class=
                    "command"><strong>telinit</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    Tells <span class="command"><strong>init</strong></span>
                    which run-level to change to
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="sysklogd.html" title="Sysklogd-1.5">Prev</a>
          <p>
            Sysklogd-1.5
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="tar.html" title="Tar-1.26">Next</a>
          <p>
            Tar-1.26
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 7.3">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
